/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.haipv.gtkhoa501.model;

/**
 *
 * @author PHANHAI
 */
public class Exam {

    private int id;
    private Question question;
    private int answer;

    public Exam() {
    }

    public Exam(int id, Question question) {
        this.id = id;
        this.question = question;
    }

    public Exam(int id, Question question, int answer) {
        this.id = id;
        this.question = question;
        this.answer = answer;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Question getQuestion() {
        return question;
    }

    public void setQuestion(Question question) {
        this.question = question;
    }

    public int getAnswer() {
        return answer;
    }

    public void setAnswer(int answer) {
        this.answer = answer;
    }

    public boolean checkAnswer() {
        return (answer == question.getAnswer());
    }
}
